//
//  UINavigationController+extension.swift
//  iUtil
//
//  Created by wdc on 2019/4/25.
//  Copyright © 2019 wendachuan. All rights reserved.
//

import UIKit

public extension UINavigationController {
    /// 隐藏NavigationBar底部黑线
    ///
    /// - Parameter hide:
    func hairLine(hide: Bool) {
        for subview in self.navigationBar.subviews {
            if subview.isKind(of: UIImageView.self) {
                for hairline in subview.subviews {
                    if hairline.isKind(of: UIImageView.self) && hairline.bounds.height <= 1.0 {
                        hairline.isHidden = hide
                    }
                }
            }
        }
    }
}
